<template>
	<view>
		<stop isBack>
			<view slot="content">信息确认</view>
		</stop>
<!-- 		<view class="lh2 bcf pad2 bdtso mart3">
			<view class="list-style-2 flrc">
				<view class="flex1">类型</view>
			</view>
			<sradio model="StoreLogType" v-model="en.type"></sradio>
		</view> -->
		<view class="flrc text-orange mar3 pad2 bdso line-orange">
			<view class="wh20-20 flcc">
				<view class="fa fa-warning fa-2x"></view>
			</view>
			<view>完成前，请确认交接内容无误</view>
		</view>
		<view class="lh2 bcf pad2 bdtso mart3">
			<view class="list-style-2 flrc">
				<view class="flex1">状态</view>
			</view>
			<sradio model="StoreLogStatus" v-model="en.status"></sradio>
		</view>
		<view class="lh2 bcf pad2 bdtso">
			<view class="tac pad2 line-green round cu-btn lg w100 mart5" @tap="submit">
				确认 <ripple></ripple>
			</view>
		</view>
		<loading :loading="myIsLoading"></loading>
	</view>
</template>

<script>
	import StoreItem from '../../templete/store/store_item.vue'
	import StoreItemSelector from '../../templete/store/store_item_selector.vue'
	export default {
		components:{StoreItem,StoreItemSelector},
		data() {
			return {
				id:"",
				en:{
					id:'',
					type:'',
					status:''
				}
			}
		},
		methods: {
			
			submit(){
				this.log(this.en)
				//检查数据
				if(this.isnull(this.en.type)){this.$com.showToast('请选择类型');return;}
				if(this.isnull(this.en.status)){this.$com.showToast('请选择状态');return;}
				if(this.isnull(this.en.id)){this.$com.showToast('数据异常');return;}
				this.$api.patch("/api/storeLogs/" + this.id,this.en,(res)=>{
					this.log(res)
					if(res.s == 1){
						this.goback()
					}
				})
			}
		},
		onLoad(option) {
			this.id = option.id
			this.en.id = option.id
			this.$api.get("/api/storeLogs/" + this.id, {},res=>{
				this.log(res)
				this.clearLoading()
				this.en = res.d
			})
		}
	}
</script>

<style>

</style>
